﻿using Microsoft.AspNetCore.Http;

namespace MES.Core.Filter
{
    /// <summary>
    /// httpheader访问器
    /// </summary>
    public class HttpHeaderAccessor : IHttpHeaderAccessor
    {
        /// <summary>
        /// the HttpContextAccessor
        /// </summary>
        private readonly IHttpContextAccessor _httpContextAccessor;

        public IHeaderDictionary HttpHeader => _httpContextAccessor.HttpContext.Request.Headers;

        /// <summary>
        /// ctor
        /// </summary>
        /// <param name="httpContextAccessor">the HttpContextAccessor</param>
        public HttpHeaderAccessor(IHttpContextAccessor httpContextAccessor)
        {
            _httpContextAccessor = httpContextAccessor;
        }
    }
}
